Merging watershed segmentations basins in civil engineering

ABSTRACT

A computer-implemented method for civil engineering is described that includes obtaining a watershed segmentation of a terrain. The watershed segmentation includes basins. The method further includes merging first basins of the watershed segmentation that each verify a smallness criterion, each with a second basin downstream to the first basin.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority under 35 U.S.C. § 119 or 365 toEuropean Application No. 19306532.3, filed Nov. 28, 2019. The entirecontents of the above application(s) are incorporated herein byreference.

FIELD OF THE DISCLOSURE

The disclosure relates to the field of computer programs and systems,and more specifically to methods, systems and programs for civilengineering.

BACKGROUND

A number of systems and programs are offered on the market for thedesign, the engineering and the manufacturing of objects. CAD is anacronym for Computer-Aided Design, e.g. it relates to software solutionsfor designing an object. CAE is an acronym for Computer-AidedEngineering, e.g. it relates to software solutions for simulating thephysical behavior of a future product. CAM is an acronym forComputer-Aided Manufacturing, e.g. it relates to software solutions fordefining manufacturing processes and operations. In such computer-aideddesign systems, the graphical user interface plays an important role asregards the efficiency of the technique. These techniques may beembedded within Product Lifecycle Management (PLM) systems. PLM refersto a business strategy that helps companies to share product data, applycommon processes, and leverage corporate knowledge for the developmentof products from conception to the end of their life, across the conceptof extended enterprise. The PLM solutions provided by Dassault Systèmes(under the trademarks CATIA, ENOVIA and DELMIA) provide an EngineeringHub, which organizes product engineering knowledge, a Manufacturing Hub,which manages manufacturing engineering knowledge, and an Enterprise Hubwhich enables enterprise integrations and connections into both theEngineering and Manufacturing Hubs. All together the system delivers anopen object model linking products, processes, resources to enabledynamic, knowledge-based product creation and decision support thatdrives optimized product definition, manufacturing preparation,production and service.

Within this context and other contexts, civil engineering is gainingwide importance.

The followings papers and software relate to this field and are referredto hereunder:

-   [1] Attali, D., Glisse, M., Hornus, S., Lazarus, F., & Morozov, D.    (2009). Persistence-sensitive simplification of functions on    surfaces in linear time. TOPOINVIS, 9, 23-24;-   [2] Autodesk Civil 3D software;-   [3] Banchoff, T. (1967). Critical points and curvature for embedded    polyhedra. Journal of Differential Geometry, 1(3-4), 245-256;-   [4] Bentley Power Civil software;-   [5] BlueMarble GlobalMapper software;-   [6] Bremer, P.-T., Hamann, B., Edelsbrunner, H., & Pascucci, V.    (2004). A topological hierarchy for functions on triangulated    surfaces. Bremer, P-T; Hamann, Bernd; Edelsbrunner, Herbert;    Pascucci, Valerio, 10(4), 385-396;-   [7] Čomić, L., De Floriani, L., Magillo, P., & Iuricich, F. (2014).    Morphological modeling of terrains and volume data. Springer New    York;-   [8] Danovaro, E., De Floriani, L., Magillo, P., & Mostefa    Mesmoudi, M. (2003). Morphology-Driven Simplification and    Multiresolution. Proceedings of the 11th ACM international symposium    on Advances in geographic information systems, 63-70;-   [9] Edelsbrunner, H., Harer, J., & Zomorodian, A. (2003).    Hierarchical Morse-Smale Complexes for Piecewise Linear 2-Manifolds.    Discrete and Computational Geometry, 30(1), 87-107;-   [10] Forman, R. (1998). Morse theory for cell complexes;-   [11] Gyulassy, A., Natarajan, V., Pascucci, V., & Hamann, B. (2007).    Efficient computation of Morse-Smale complexes for three-dimensional    scalar functions. IEEE Transactions on Visualization and Computer    Graphics, 1440-1447;-   [12] Kozlov, D. (2008). Combinatorial Algebraic Topology. Springer;-   [13] Matsumoto, Y. (2001). An introduction to Morse Theory. American    Mathematical Society;-   [14] Meyer, F. (1994). Topographic distance and watershed lines.    Signal processing, 38(1), 113-125;-   [15] Takahashi, S., Ikeda, T., Shinagawa, Y., Kunii, T. L., &    Ueda, M. (1995). Algorithms for extracting correct critical points    and constructing topological graphs from discrete geographical    elevation data. Computer Graphics Forum, 181-192; and-   [16] Wolhuter, K. (2015). Geometric Design of Roads Handbook. CRC    Press.

All these methods suffer from a lack of accuracy and/or robustnessand/or efficiency and/or speed, and/or do not provide satisfactoryresults.

Therefore, there is a need for an improved method for civil engineering.

SUMMARY

It is therefore provided a computer-implemented method for civilengineering. The method comprises providing a watershed segmentation ofa terrain. The watershed segmentation comprises basins. The methodfurther comprises merging first basins of the watershed segmentationthat each verify a smallness criterion, each with a second basindownstream to the first basin.

The method may comprise one or more of the following:

-   -   the watershed segmentation comprises, for each basin, data        representing water trajectory within the basin, and the merging        comprises, for each first basin that is merged with a second        basin, computing data representing a water trajectory between        the first basin and the second basin;    -   the computing of the data representing the water trajectory        between the first basin and the second basin is based on first        data representing water trajectory within the first basin and        second data representing water trajectory within the second        basin;    -   the first data comprise a path from an outlet of the first basin        to a spillway of the first basin, and/or the second data        comprise a path from a spillway of the first basin to an outlet        of the second basin;    -   the merging comprises:        -   determining an oriented graph having nodes and arcs, each            node representing a basin, and each arc representing a            connection between a first basin that verifies the smallness            criterion and a second basin downstream to the first basin,            the arc being oriented from a first node representing the            first basin to a second node representing the second basin;            and        -   merging the basins corresponding to nodes of a same            connected component of the oriented graph;    -   the determining of the oriented graph comprises exploring the        basins according to a smallness order that rewards basin        smallness, and for each explored first basin verifying the        smallness criterion, creating an arc between the node        representing the first basin and the node representing a second        basin downstream to the first basin, the arc being oriented from        the node representing the first basin to the node representing        the second basin;    -   a basin verifies the smallness criterion if a quantification of        a smallness of the basin is lower than a predefined threshold;    -   the quantification of the smallness of the basin comprises one        or more of a quantification of a depth of the basin, a        quantification of an area of the basin and/or a quantification        of a volume of the basin; and/or    -   the terrain is a construction terrain.

It is further provided a computer program comprising instructions forperforming the method.

It is further provided a device comprising a data storage medium havingrecorded thereon the computer program.

The device may form or serve as a non-transitory computer-readablemedium, for example on a SaaS (Software as a service) or other server,or a cloud based platform, or the like. The device may alternativelycomprise a processor coupled to the data storage medium. The device maythus form a computer system in whole or in part (e.g. the device is asubsystem of the overall system). The system may further comprise agraphical user interface coupled to the processor.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments will now be described, by way of non-limiting example, andin reference to the accompanying drawings, where:

FIGS. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 and 36illustrate the present disclosure; and

FIG. 37 shows an example of the system.

DETAILED DESCRIPTION

It is provided computer-implemented methods for civil engineering.

It is notably provided a first computer-implemented method for civilengineering.

The first method comprises providing a mesh representing a terrain. Thefirst method further comprises computing a watershed segmentation of theterrain based on the mesh. The computing of the watershed segmentationincludes identifying one or more saddle points on the mesh. Thecomputing of the watershed segmentation further includes, for eachidentified saddle point, identifying paths each ascending from thesaddle point according to a direction of a local maximal slope aroundthe saddle point, and a path descending from the saddle point accordingto a direction of a steepest slope around the saddle point. Theidentified ascending paths divide the mesh into connected components.The computing of the watershed segmentation further includes, for eachidentified saddle point, merging each connected component of whichbottom point is the saddle point with a connected component comprisingthe identified path descending from the saddle point according to adirection of a steepest slope around the saddle point. The mergingyields at least a part of a basin. The first method may be referred toas “the watershed segmentation method”.

The watershed segmentation method constitutes an improved method forcivil engineering.

Notably, the watershed segmentation method allows to perform a watershedsegmentation of a terrain represented by a mesh, i.e. to perform thesegmentation of the terrain into one or more drainage basins (sometimessimply referred to as “basins” hereinafter) bounded by watershed lines(which are discussed hereinafter). The watershed segmentation methodnotably yields basins and watershed lines of the terrain. For example,the identified ascending paths comprise ascending watershed lines.However, at least some of the identified ascending paths are notwatershed lines. The watershed segmentation of the terrain is objectivephysical information on the terrain that allows for example to segmentthe terrain into parts on which the water flow has similar behavior thatis into drainage basins. This eventually allows to perform a civilengineering analysis and/or to perform one or more physical actionspertaining to civil engineering on the terrain, as further discussedhereinafter.

Furthermore, the watershed segmentation is performed based on the meshthat represents the terrain, which means that the watershed segmentationis directly performed on the input (i.e. provided) mesh, i.e. does notrequire any modification of the input mesh. Such a modification couldindeed degrade the quality of the mesh, e.g. the degree of realism withwhich the input mesh represents the terrain. In contrast, as thismodification does not happen with the watershed segmentation method, thewatershed segmentation method is accurate and robust, and yields arelatively realistic watershed segmentation of the terrain. Also, thequality, in terms of realism of the result, of the watershedsegmentation computed by the watershed segmentation method does notdepend on the size and/or the regularity of the mesh.

In addition, the watershed segmentation method performs watershedsegmentation on a mesh that comprises one or more saddle points. Now, asknown per se from the field of civil engineering, a mesh representing aterrain almost always comprises one or more saddle points, as theterrain does in the real world.

The watershed segmentation method thus allows performance of watershedsegmentation on a quality mesh, as the latter comprises one or moresaddle points. The watershed segmentation method is thus accurate andyields a realistic watershed segmentation of the terrain.

Moreover, the watershed segmentation computed by the watershedsegmentation method is, as said, directly performed on the meshcomprising one or more saddle point. The watershed segmentation thushandles the almost inevitable presence of saddle points on the meshwithout modifying the input mesh, which makes the watershed segmentationmethod robust and efficient. The watershed segmentation does so byidentifying, for each identified saddle point, several paths eachascending from the saddle point according to a local maximal slopedirection and a path descending from the saddle point with a steepestslope direction. In this manner, the watershed segmentation methoddivides the mesh into connected components, each bounded by twoidentified ascending paths. Specifically, the identifying of the pathsdivides the mesh into connected components each corresponding to eithera connected part of the terrain having the saddle point as bottom, andon which the water necessarily flows towards the saddle point, or to aconnected part of the terrain forming a steepest valley descending fromthe saddle point. It is to be understood that the water does not stopand stay at the saddle point: it transits/flows by it, to eventuallyreach altitude minima, which are basins' lowest points. The watershedsegmentation method then merges each connected component having thesaddle point as bottom with a valley of steepest slope around the saddlepoint. This merging results in a single connected component of the meshcomprising the saddle point and representing a connected part of theterrain on which the water necessarily flows downstream and into aunique basin. In other words, the single connected component forms atleast a part of a basin. As such basin parts are determined for eachidentified saddle point, the watershed segmentation eventuallydetermines full basins segmenting the terrain.

Furthermore, in examples, at least one of the identified one or moresaddle points is a degenerate saddle point. Thus, the watershedsegmentation method handles degenerate saddle points, which often existwhen representing realistically a real world terrain with a mesh. Thewatershed segmentation method thus takes as input a realistic meshrepresentation of the terrain and outputs a realistic watershedsegmentation of it. Moreover, the watershed segmentation method handlesthe degenerate saddle points without modifying the input mesh, whichmakes the watershed segmentation method particularly robust andefficient.

It is also provided a second computer-implemented method for civilengineering.

The second method comprises providing a watershed segmentation of aterrain. The watershed segmentation comprises basins. The second methodfurther comprises merging first basins of the watershed segmentationthat each verify a smallness criterion, each with a second basindownstream to the first basin. The second method may be referred to as“the regularization method”.

The regularization method constitutes an improved method for civilengineering.

Notably, the regularization method allows regularization of the providedwatershed segmentation of the terrain. Regularizing the watershedsegmentation means merging basins of the watershed segmentation so thatthe merging results into merged basins, also referred to as filteredbasins, each violating the smallness criterion. In other words, themerging results into large filtered basins.

Regularizing the watershed segmentation of the terrain as does theregularization method notably allows to get rid (or at least to reducethe number of) small basins which correspond to numerical artefactsand/or noise. In other words, depending on how the provided watershedsegmentation has been computed, the watershed segmentation may compriseone or more basins which are not supposed to exist in the real world,but which exist numerically because of numerical artefacts and/or noise.The numerical artefacts and/or the noise may result from physicalmeasurements performed to acquire data on the terrain (this is furtherdiscussed hereinafter), e.g. to obtain a mesh representing the terrain.Alternatively or additionally, the numerical artefacts and/or the noisemay correspond to non-significative details about the terrain (e.g. amolehill). These basins respect the smallness criterion. Theregularization method filters these basins by merging them into largerones.

Additionally or alternatively, one or more basins may each verify thesmallness criterion because they are small in the real world. However,they are so small that they are not meaningful to the civil engineer,e.g. they do not influence much the water trajectory and/or otherphysical phenomenon on the terrain because of their smallness. Onlylarger filtered basins may have such an influence. The regularizationmethod allows obtaining of such filtered basins. In other words, theregularization method yields a filtered segmentation which is meaningfulto the civil engineer.

In any case, where, as previously discussed, the watershed segmentationconstitutes an objective physical information allowing a civilengineering analysis and/or one or more civil engineering physicalactions to be performed, regularizing this watershed segmentationaccording to the watershed segmentation method improves relevance ofthis physical information.

Furthermore, the regularization method does not modify therepresentation of the terrain (e.g. a mesh) to perform theregularization of the watershed segmentation. Notably, theregularization method does not modify any basin's characteristics assuch, but only merges basins. As previously discussed in the context ofthe watershed segmentation method, not modifying the representation ofthe terrain (e.g. a mesh) contributes to improve the realism of theresults yielded by the regularization method.

It is also provided a third computer-implemented method of civilengineering.

The third method comprises providing a mesh representing a terrain and apolyline on the mesh. The third method further comprises computing acontributor of the polyline. The computing of the contributor comprisesmodifying the mesh by determining, based on the polyline, a trench belowthe polyline. The computing of the contributor further comprisescomputing a watershed segmentation of the terrain based on the modifiedmesh. The computing of the contributor further comprises, based on thecomputed watershed segmentation, identifying, on the modified mesh, abasin comprising the trench. The contributor corresponds to theidentified basin. The third method may be referred to as “thecontributor computation method”.

The contributor computation method constitutes an improved method forcivil engineering.

Notably, the contributor computation method allows to compute thecontributor of a polyline, that is a contributor (i.e. an area of theterrain from which water necessarily flows towards the polyline andreaches it) of two or more points connected by line segments. Thepolyline may typically represent an alignment on the terrain such as aroad, a railroad, a channel, a mine or a building. The contributor thusconstitutes objective physical information for civil engineering, as itallows determination of the water trajectory of the water flowing acrossthe polyline. This objective physical information may be used forperforming a civil engineering analysis and/or one or more civilengineering physical actions, as further discussed hereinafter.

Furthermore, the contributor computation method proceeds in three steps:modifying the mesh by creating a trench below the polyline, computingbasins of the modified mesh by computing a watershed segmentation of themodified mesh, identifying a basin on the segmentation that correspondsto the contributor. Moreover, these three steps compute the contributorof the polyline using a single operation, i.e. these steps compute allpoints (e.g. mesh vertices) of the contributor all at once, and not oneby one. This makes the contributor computation method fast, robust,efficient, and accurate. Furthermore, the produced results areconsistent with the results of the watershed segmentation. Besides, thecomputation is not affected by/does not depend on the complexity and/orthe accuracy of the polyline, which makes the contributor computationmethod further robust and efficient.

The watershed segmentation method, the regularization method and thecontributor computation method may be performed independently from eachother. Alternatively, the watershed segmentation method, theregularization method and/or the contributor computation method may becombined. For example, the watershed segmentation provided according tothe regularization method may be the watershed segmentation computedaccording to the watershed segmentation method. For example, theproviding of the watershed segmentation of the regularization method maycomprise the providing of the mesh representing the terrain according tothe watershed segmentation method and the computing of the watershedsegmentation according to the watershed segmentation method, thecomputed watershed segmentation being the provided watershedsegmentation. Additionally or alternatively, the computing of watershedsegmentation according to the contributor computation method may becarried out according to the computing of watershed segmentationaccording to the watershed segmentation method.

The watershed segmentation method, the regularization method and/or thecontributor computation method may be integrated into a same process ofcivil engineering, also referred to as “the civil engineering process”.In other words, the civil engineering process comprises performing oneor more of the watershed segmentation method, the regularization methodand/or the contributor computation method.

Specifically, the civil engineering process comprises providing a meshrepresenting a terrain.

The civil engineering process may in examples further comprise a step ofunderstanding the topography of the terrain. Understanding the terrainmay comprise identifying elements of the terrain such as ridges and/orvalleys. Understanding the terrain may start by computing, by a user,the slope on the terrain, e.g. on each triangle of the mesh.Understanding the terrain may then comprise estimating, by a user,valleys and ridges. Valleys and ridges provide the user with enoughinformation for launching the computation of the watershed segmentationon a portion of the terrain of particular interest. They also allow theuser to deduce new information (e.g. estimation of water quantityreceived by an outlet for dimensioning drainage systems). It is to benoted that the contributor computation may replace the computation ofthe watershed segmentation, e.g. when the user is conceiving a work ofart. The user may also modify a road alignment if the contributorcomputation indicates that drainage systems are not going be sufficient:this allows looping back between the work of art conception and theestimation of the quantity of water.

The civil engineering process may then comprise computing a watershedsegmentation of the terrain based on the mesh, the computing of thewatershed segmentation being the computing of watershed segmentationaccording to the watershed segmentation method. The civil engineeringprocess may then comprise regularizing the computed watershedsegmentation by merging first basins of the computed watershedsegmentation that each verify a smallness criterion, each with a secondbasin downstream to the first basin, the merging being the merging ofthe regularization method. This improves robustness as the small (e.g.shallow) basins of the computed watershed segmentation are therebyfiltered.

Additionally or alternatively, the civil engineering process maycomprise providing a polyline on the mesh, according to the contributorcomputation method, and computing a contributor of the polylineaccording to the contributor computation method. The computing of thecontributor comprises computing a watershed segmentation of the terrainbased on the modified mesh, as previously discussed. The computing ofthe watershed segmentation may comprise computing, according to thewatershed segmentation method, an initial watershed segmentation of theterrain based on the modified mesh and performing a regularization ofthe computed initial watershed segmentation, according to theregularization method. This is further discussed hereinbelow.

The civil engineering process thus yields one or more of: a watershedsegmentation method computed by the watershed segmentation method and/orregularized by the regularization method and/or a contributor of apolyline computed by the contributor computation method. The civilengineering process may further comprise displaying the computed and/orregularized watershed segmentation and/or the computed contributor. Theprocess thus allows, e.g. based on the display, to determine thetrajectory of the water flowing across some part of the terrain and/orto segment the terrain into part on which the water flow has similarbehavior. This allows performance of civil engineering analysis on theterrain, as discussed hereinafter.

The civil engineering process may further comprise performing a civilengineering analysis based on the computed and/or regularized watershedsegmentation and/or the computed contributor. The civil engineeringprocess may further comprise performing one or more physical actionsbased on the civil engineering analysis, the computed and/or regularizedwatershed segmentation, and/or the computed contributor. The civilengineering analysis and/or the one or more physical actions may beperformed while the computed and/or regularized watershed segmentationand/or the computed contributor is/are displayed on a computer display.This allows guidance of the civil engineer when performing the task ofcivil engineering analysis and/or when performing one or more physicalactions.

Specifically, each one of the computed and/or regularized watershedsegmentation and of the computed contributor forms objective physicalinformation based on which the civil engineering analysis and/or the oneor more physical actions may be performed, e.g. based on the display ofsaid objective physical information. The one or more physical actionsmay also be performed based on the civil engineering analysis.

The civil engineering analysis may comprise analyzing and/or designingthe terrain and/or human construction on the terrain, based on (e.g. thedisplay of) the computed and/or regularized watershed segmentationand/or the computed contributor. The civil engineering may comprise oneor more of the following:

-   -   Topographic analysis, e.g. based on (e.g. the display of) the        computed and/or regularized watershed segmentation;    -   Determination of water flow on the terrain, e.g. based on (e.g.        the display of) the computed and/or regularized watershed        segmentation;    -   Segmenting the terrain into watersheds, e.g. based on (e.g. the        display of) the computed and/or regularized watershed        segmentation;    -   Visualizing an area of the terrain from which the rainfall is to        reach a particular area of interest, such as a planned or        existing road alignment, e.g. based on (e.g. the display of) the        computed contributor of the particular area of interest (e.g.        road alignment), the polyline representing the particular area        of interest (e.g. road alignment);    -   Sizing of drainage tools for draining one or more ditches on the        terrain e.g. around a road, a railroad, a channel, a mine and/or        a building, e.g. based on (e.g. the display of) the computed        contributor of the road, the railroad, the channel, the mine        and/or the building, the polyline representing the road, the        railroad, the channel, the mine and/or the building;    -   Designing one or more rainwater drainage systems, e.g. based on        (e.g. the display of) the computed and/or regularized watershed        segmentation;    -   Designing a drainage basin for a planned or existing road        alignment, e.g. based on (e.g. the display of) the computed        contributor of the road alignment, the polyline representing the        road alignment;    -   Determination of the influence of water flow on one or more        urban constructions on the terrain, e.g. based on (e.g. the        display of) the computed and/or regularized watershed        segmentation and/or each computed contributor of each respective        one of said urban constructions, the polyline representing the        respective one of said urban constructions;    -   Modifying the design of a human construction to be constructed        on the terrain, e.g. based on (e.g. the display of) the computed        and/or regularized watershed segmentation and/or the computed        contributor of the construction, the polyline representing the        construction;    -   Determination of the influence of building a dam on the terrain,        e.g. based on (e.g. the display of) the computed and/or        regularized watershed segmentation and/or the computed        contributor of the dam, the polyline representing the dam;    -   Determination of the influence of a dyke implantation, e.g.        based on (e.g. the display of) the computed and/or regularized        watershed segmentation and/or the computed contributor of the        dyke, the    -   Determination of the influence of water flow on a mine of the        terrain and/or determination of the influence of building the        mine on the terrain, e.g. based on (e.g. the display of) the        computed and/or regularized watershed segmentation and/or the        computed contributor of the mine, the polyline representing the        mine.

The one or more physical actions may comprise performing natural riskmanagement and/or construction work and/or maintenance work on theterrain and/or on one or more human constructions on the terrain, basedon (e.g. the display of) the computed and/or regularized watershedsegmentation, the computed contributor and/or the civil engineeringanalysis. The one or more physical actions may notably comprise one ormore of the following:

-   -   performing natural risk management based on water flow        estimation, e.g. stemming from the computed and/or regularized        watershed segmentation, the computed contributor and/or the        civil engineering analysis. The natural risk management may        comprise determining whether the risk associated with the        implementation of a structure at a given location is acceptable.        This may comprise determining the quantity of water received        around the given location and comparing it with means of        prevention (e.g. dike, drain);    -   Constructing and/or modifying one or more roads, railroads,        channels, mines and/or buildings on the terrain. The        constructing and/or the modifying may be based on (e.g. a        display of) the computed contributor of each road, railroad,        channel, mine and/or building, the polyline representing the        road, railroad, channel, mine and/or building. Additionally or        alternatively, the constructing and/or the modifying may be        based on the result of the civil engineering analysis. The        result may comprise one or more of:        -   the topographic analysis,        -   the determined water flow on the terrain,        -   the topography of the terrain,        -   the watersheds segmenting the terrain,        -   the area from which the rainfall is to reach the road,            railroad, channel, mine and/or building,        -   the determined influence of water flow on the one or more            roads, railroads, channels, mines and/or buildings,        -   the modified design of the road, railroad, channel, mine            and/or building,        -   the determined influence of building a dam on the terrain,        -   the determined influence of a dyke implantation;    -   Constructing and/or modifying a dam on the terrain. The        constructing and/or the modifying may be based on (e.g. a        display of) the computed contributor of the dam, the polyline        representing the dam. Additionally or alternatively, the        constructing and/or the modifying may be based on the result of        the civil engineering analysis. The result may comprise one or        more of:        -   the topographic analysis,        -   the determined water flow on the terrain,        -   the topography of the terrain,        -   the watersheds segmenting the terrain,        -   the determined influence of building the dam on the terrain,        -   the determined influence of a dyke implantation or of a            drainage system,    -   Constructing and/or modifying a road alignment. The constructing        and/or the modifying may be based on (e.g. a display of) the        computed contributor of the road alignment, the polyline        representing the road, alignment. Additionally or alternatively,        the constructing and/or the modifying may be based on the result        of the civil engineering analysis. The result may comprise one        or more of:        -   the topographic analysis,        -   the determined water flow on the terrain,        -   the topography of the terrain,        -   the watersheds segmenting the terrain,        -   the area from which the rainfall is to reach the road            alignment,        -   the designed drainage basins for the road alignment,        -   the determined influence of water flow on the road            alignment,        -   the determined influence of building a dam on the terrain,        -   the determined influence of a dyke implantation;    -   Constructing and/or modifying a mine on the terrain. The        constructing and/or the modifying may be based on (e.g. a        display of) the computed contributor of the mine, the polyline        representing the mine. Additionally or alternatively, the        constructing and/or the modifying may be based on the result of        the civil engineering analysis. The result may comprise one or        more of:        -   the topographic analysis,        -   the determined water flow on the terrain,        -   the topography of the terrain,        -   the watersheds segmenting the terrain,        -   the area from which the rainfall is to reach the mine,        -   the modified design of the mine,        -   the determined influence of a dyke implantation,        -   the determined influence of building a dam on the terrain,        -   the determined influence of water flow on the mine and/or of            the influence of building the mine on the terrain;    -   Terraforming, e.g. around a human construction on the terrain.        The terraforming may be based on (e.g. a display of) the        computed and/or regularized watershed segmentation. Additionally        or alternatively, the terraforming may be based on the result of        the civil engineering analysis. The result may comprise one or        more of:        -   the topographic analysis,        -   the determined water flow on the terrain,        -   the topography of the terrain,        -   the watersheds segmenting the terrain,        -   the determined influence of water flow on the construction,        -   the modified design of the construction,        -   the determined influence of building a dam on the terrain,        -   the determined influence of a dyke implantation;    -   Constructing one or more water management systems on the        terrain. The constructing may be based on (e.g. a display of)        the computed and/or regularized watershed segmentation.        Additionally or alternatively, the constructing may be based on        the result of the civil engineering analysis. The result may        comprise one or more of:        -   the topographic analysis,        -   the determined water flow on the terrain,        -   the topography of the terrain,        -   the watersheds segmenting the terrain,        -   the sized drainage tools for draining one or more ditches on            the terrain,        -   the designed one or more rainwater drainage systems,        -   the determined influence of water flow on the one or more            constructions on the terrain,        -   the determined influence of building a dam on the terrain,        -   the determined influence of a dyke implantation; and/or    -   Constructing one or more drainage systems on the terrain. The        constructing may be based on (e.g. a display of) the computed        and/or regularized watershed segmentation. Additionally or        alternatively, the constructing may be based on the result of        the civil engineering analysis. The result may comprise one or        more of:        -   the topographic analysis,        -   the determined water flow on the terrain,        -   the topography of the terrain,        -   the watersheds segmenting the terrain,        -   the sized drainage tools for draining one or more ditches on            the terrain,        -   the designed one or more rainwater drainage systems,        -   the determined influence of water flow on the one or more            constructions on the terrain,        -   the determined influence of building a dam on the terrain,        -   the determined influence of a dyke implantation.

The methods and process are for civil engineering.

As known per se, civil engineering is a field of engineering thatencompasses the study of means of transport and of work of arts,including public works such as roads, bridges, channels, dams, airports,sewerage systems, pipelines, structural components of buildings, andrailways. Thus, each one of the methods and the process pertains todetermining and/or computing objective physical information (i.e.watershed segmentation, regularized watershed segmentation and/or acontributor) on a terrain that pertains to civil engineering. Each oneof the methods and process also belong to the field of topographyanalysis and geometrical simulation, as they allow to determine thetrajectory of the water flowing across some part of the terrain, and/orto segment the terrain into part on which the water flow has similarbehavior.

In the context of the present disclosure, a terrain is a portion of thesoil surface of the earth. A terrain has landform. In the context of thepresent disclosure, the terrain is impervious, i.e. the water only flowson the terrain surface without any permeation phenomenon. Imperviousterrains are often contemplated in civil engineering methods for severalobjective physical reasons. For example, in an urban context, theterrain being at least partially urbanized, most of the soil has beenmade impervious due to permanent covering of the soil surface with animpermeable material. Even in non-urban context, the soil capacity toabsorb water is reached in case of heavy rainfall: the soil is thenconsidered as impervious because water can no longer infiltrate into theground.

Each terrain herein may be a construction terrain. A constructionterrain is a terrain:

-   -   comprising one or more human constructions such as roads,        bridges, channel, mines, dams, airports, sewerage systems,        pipelines, buildings, structural components of buildings and/or        railways; and/or    -   on which one or more human constructions such as roads, bridges,        channel, mines, dams, airports, sewerage systems, pipelines,        buildings, structural components of buildings and/or railways        are to be constructed, e.g. based on a civil engineering        analysis.

Each terrain herein is represented by a discrete geometricalrepresentation. Said otherwise, the civil engineering methods herein areeach performed on a discrete geometrical representation of a terrain.Each one of the civil engineering methods and process herein may notablycomprise providing a geometrical representation of the terrain. Forexample, the watershed segmentation method and the contributorcomputation method both comprise providing, as a discrete geometricalrepresentation of the terrain, a mesh representing the terrain.

The discrete geometrical representation of the terrain is herein a datastructure which comprises a discrete set of pieces of data. Each pieceof data represents a respective geometrical entity (e.g. a point, asurface) of the terrain. Each geometrical entity represents a respectivelocation of the terrain (in other words, a respective portion of thesoil surface). The aggregation (i.e. union or juxtaposition) of thegeometrical entities represents altogether the terrain. Any discretegeometrical representation herein may in examples comprise a number ofsuch pieces of data higher than 1 000 000. The discrete geometricalrepresentation may be two-dimensional or three-dimensional.

The discrete geometrical representation of the terrain may be a mesh,each geometrical entity being a mesh element such as a tile or face. Anymesh herein may be a 3D mesh or a 3D mesh. Any mesh herein may beregular or irregular (i.e. consisting or not of faces of a same type).Any mesh herein may be a polygonal mesh, for example a triangular mesh,the mesh faces being triangles, each bounded by mesh edges, each boundedby mesh vertices. Any mesh herein may be obtained from a point cloud,for example by triangulating the point cloud (e.g. with a Delaunaytriangulation).

Any mesh representing a terrain herein may stem from (i.e. may bedetermined from) physical measurements performed on the terrain, forexample within a reconstruction process. The reconstruction process maycomprise performing one or more Lidar surveys of the terrain, as knownper se from the field of civil engineering. The reconstruction processmay additionally or alternatively comprise one or more surveys bytriangulation of parts of the terrain, as known per se from the field ofcivil engineering. The reconstruction process may alternatively oradditionally comprise performing photogrammetry on the terrain, as knownper se from the field of civil engineering. The Lidar surveys, thesurveys by triangulation and/or the photogrammetry may yield a pointcloud representing the terrain, and the reconstruction process mayfurther comprise triangulating the point cloud to obtain the mesh. Anymesh representing a terrain herein may be a Digital Elevation Model, asknown per se from the field of civil engineering. Additionally oralternatively, any mesh representing a terrain herein may be a 3Dtriangular mesh that can be parametrized by a 2D subset D of the Oxyplane. In other words, the projection of the mesh triangles induces atriangulation of the domain D, which entails that there is nooverhanging triangle in the mesh.

The watershed segmentation method and the contributor computation methodboth comprise providing a mesh representing a terrain. Providing themesh representing the terrain may comprise building the mesh, forexample by performing a reconstruction process as previously discussed.Alternatively, providing the mesh may comprise retrieving the mesh forma (e.g. distant) memory on which the mesh has been stored after itsbuilding.

Information related to water trajectory on the terrain, such aswatershed segmentation or contributors, constitutes objective physicalinformation for civil engineering, based on which a civil engineer canperform a civil engineering analysis and/or one or more physical actionsas previously discussed. Concepts related to water trajectory are nowdiscussed.

The altitude on the terrain may be encapsulated by an altitude functionƒ which is defined on the discrete geometrical representation of theterrain and which takes real values. The value of ƒ at a point of thediscrete geometrical representation corresponds to the altitude at thispoint. Note that when ƒ is differentiable, its gradient is a vectorwhich represents the steepest slope at each point.

A point A of the discrete geometrical representation is said to flowtoward a point B if there is a unique downward path from A to B on thediscrete geometrical representation and if for any point P on that path,the tangent vector of the path at point P is collinear to the slopevector grad(ƒ(P)). In other words, the path follows the maximal downward(also referred to as “descending”) slope. The path may be referred to asa flow line.

A drainage basin (also simply referred to as “basin”) of the terrain isrepresented on the discrete geometrical representation by a set ofpoints that will flow toward the same point. This point represents anoutlet of the basin and is a local minima of the altitude function. Inother words the drainage basins are the attraction points of the waterflow induced by the opposite of the gradient of the altitude function.As a result of the watershed segmentation performed by the watershedsegmentation method, the boundaries of the basins are represented on thediscrete geometrical representation by the watershed lines. Thewatershed lines divide the water flow so that any pair of points lyingfrom either side of the watershed lines will give rise to two paths thatwill reach two different outlets. It is to be noted that, in exampleswhere the terrain is represented by a triangle mesh, the boundaries ofthe basins are polylines which each may or may not pass through meshtriangles.

The contributor of a subset S of the discrete geometrical representationof the terrain is the set of points of the terrain from which a pathwill reach a point of S, that is from which water will flow towards apoint of S. For example, the contributor of a local minimum of thealtitude function is given by the drainage basin associated to thatoutlet.

In the context of the present disclosure, a watershed segmentation ofthe terrain is a segmentation of the discrete geometrical representationof the terrain into parts of the discrete geometrical representationeach representing a respective basin of the terrain. Boundaries of eachrespective one of these parts are the watershed lines of the respectivebasin represented by the respective one part and represent theboundaries of the respective basin. Any watershed segmentation hereinmay further comprise data representing one or more physical propertieswithin basins of the watershed segmentation. Such a physical propertymay for example be water trajectory within each basin of the watershedsegmentation.

A basin depth is the difference of altitude between the spillway (i.e.the lowest saddle point on the basin boundary, lowest meaning having thesmaller altitude) and the outlet. This quantity represents the maximalheight of water this basin may contain before flooding in the downstreambasin. The basin volume is the volume of the solid delimited downward bythe basin and upward by the horizontal plane containing the lowestsaddle point on the basin boundary.

FIG. 1 shows an example of a terrain 10. The terrain comprises adrainage basin 12 having an outlet 14 and a spillway 16. Double arrow 18represents the depth of the drainage basin 12.

The watershed segmentation method is now further discussed.

“Computing a watershed segmentation of the terrain based on the mesh”means determining watershed lines of the terrain by computing therepresentations of these watershed lines on the provided mesh.Equivalently, “computing watershed segmentation of the terrain” meansdetermining drainage basins of the terrain by computing therepresentations of these drainage basins on the provided mesh. Thecomputing of the watershed segmentation thus takes as input the providedmesh and determines a segmentation of the terrain into drainage basinsby computing the representations on the mesh of the watershed lines ofthese drainage basins. In other words, the watershed segmentation methodoutputs parts of the mesh (e.g. sets of faces, e.g. triangles) eachrepresenting a respective drainage basin.

The computing of the watershed segmentation includes identifying one ormore saddle points on the mesh. A saddle point on the mesh is a vertexwhich represents a saddle point of the terrain. A saddle point of theterrain is a point having at least two locally maximal descendingdirections and at least two locally maximal ascending directions thesoil surface forming for example a landform saddle or a mountain passaround the saddle point. This is illustrated in FIG. 2. In the case of asaddle point of a regular surface, the descending directions areopposed, and the ascending directions are as well opposed. This is ingeneral not the case for saddle points on a triangular surface.

In examples of the watershed segmentation method, the mesh is a 3Dtriangular mesh having triangles, edges, and vertices. In theseexamples, a saddle point of the mesh may be defined as follows. The starof a vertex V of the mesh is the set of triangles and edges that containV (i.e. V is a vertex of these triangles and edges): the star of V isdenoted St(V). The upper star (resp. lower star) of vertex V is the setof simplices of the star St(V) such that the value of ƒ at any vertexother than V is greater (resp. lower) than ƒ(V). In other words, asimplex s E St(V) belongs to the upper star if ƒ(W)>ƒ(V) for any vertex14′ of s different of V. FIG. 3 shows a part of the mesh in an exampleof the watershed segmentation method, the part of the mesh comprising avertex v. FIG. 3 shows the star 30 of V. FIG. 4 shows the same part ofthe mesh and shows the link 40 of the vertex v. As, in these examples,the terrain is represented by a triangular mesh, the altitude functionis piecewise linear (PL).

In these examples, critical points of the mesh are defined using theprevious notions of upper and lower star (see previously cited reference[3], which is incorporated herein by reference). Specifically, a regularpoint which is not a critical point is a vertex for which the upper andlower stars are formed by exactly one connected component. A localminimum is a vertex for which the lower star is empty (and the upperstar consists in a single connected component). A local maximum is avertex for which the lower star is empty (and the upper star consists ina single connected component). A saddle point is a critical point of thealtitude function and is a vertex for which the lower and the upper starconsist in at least two connected components. Equivalently it's acritical point of the altitude function which is not a local minimum andnot a local maximum.

FIGS. 5 to 10 illustrate these concepts, where upper stars are shadedand where lower stars are not. FIG. 5 shows a vertex and its incidentedges. FIG. 6 shows the case where the vertex is a critical bottom(local minimum). FIG. 7 shows the case where the vertex is a criticaltop (local maximum). FIG. 8 shows the case where the vertex is a regularvertex. FIG. 9 shows the case where the vertex is a regular saddlepoint. FIG. 10 shows the case where the vertex is a monkey saddle (theupper and lower star have tree connected components).

The identifying of the one or more saddle points may be carried out byany known method adapted for identifying saddle points on a mesh. Inexamples where the mesh is a 3D triangular mesh, the identifying of theone or more saddle points may comprise, for each vertex of the mesh,determining whether the vertex is a saddle point. Determining whetherthe vertex is a saddle point may comprise:

-   -   computing the lower star of the vertex and the upper star of the        vertex by comparing the altitude of the neighboring vertices of        the vertex; and    -   determining that the vertex is a saddle point if the computed        lower star has at least two connected components and if the        computed upper star has at least two connected components.

If the vertex is an interior vertex of the mesh, i.e. a vertex that isnot a boundary vertex, it is sufficient to analyze only the lower starof the vertex, since it is the complement of the upper star on thecircle of directions (which is discussed hereinafter) and the two havethe same number of related components. In such a case, if the vertex isan interior vertex of the mesh, determining whether the vertex is asaddle point may comprise:

-   -   computing the lower star of the vertex by comparing the altitude        of the neighboring vertices of the vertex; and    -   determining that the vertex is a saddle point if the computed        lower star has at least two connected components.

This does not hold if the vertex is a boundary vertex of the mesh.

The determining of whether the vertex is a saddle point may be carriedout by executing an algorithm which may be referred to as the “Determineif a vertex V is a saddle point” algorithm and which is described by thefollowing pseudo-code:

BEGIN ALGORITHM (Determine if a vertex V is a saddle point) - Computethe lower star Lo(V) of the vertex V by comparing the z-coordinate ofthe neighboring vertices - If Lo(V) has at least 2 connected componentsReturn true Else Return false END ALGORITHM

It is to be understood that the watershed segmentation method mayidentify all the saddle points in the mesh or at least a part of them.In examples, the watershed segmentation method identifies all the saddlepoints in the mesh.

In examples, at least one of the identified one or more saddle points isa degenerate saddle point. A degenerate saddle point on the mesh is avertex of the mesh which represents a degenerate saddle point of theterrain. A degenerate saddle point of the terrain is a point aroundwhich the soil surface curves up in at least two directions and curvesdown in at least three other directions. In fact, if the saddle pointcorresponds to an interior vertex of the mesh, there exists threedirections of locally maximal descent around the saddle point. Inexamples of the watershed segmentation method, an interior degeneratesaddle point on the mesh is a saddle point on the mesh for which thelower star comprises at least three connected components and the upperstar comprises at least three connected components.

The computing of the watershed segmentation further includes, for eachidentified saddle point, identifying paths each ascending from thesaddle point according to a direction of a local maximal slope aroundthe saddle point. A path ascending from the saddle point is a path onthe mesh that starts at the saddle point and that goes up the mesh suchthat the altitude increases along the path until the path reaches anending point which is either on a boundary of a basin or on a boundaryof the terrain. For example, the ending point may correspond to a localmaxima of the altitude function and/or may be on the boundary of themesh. The path ascends from the saddle point up to the ending pointaccording to a direction of a local maximal slope. This means that thepath tends to follow where the slope is maximal when going up to theending point. Said otherwise, the path starts at the saddle point bygoing up a local maximal slope around the saddle point (there may bemany such local maximal slopes) and then tends to always go up accordingto the steepest ascending direction. It is to be noted that theidentified ascending paths may be any path on the mesh, i.e. they do notnecessarily follow the mesh edges and can cross mesh faces. Theidentifying of the ascending paths may be carried out by any knownmethod adapted for such purpose.

In examples, the identifying of the paths ascending from the saddlepoint comprises determining slope local maxima around the saddle point.In these examples, each respective one of said paths ascending from thesaddle point is directed according to a determined slope local maxima.This is an efficient manner of identifying the ascending paths, becauseit ensures that the ascending paths start from the saddle point in thesteepest possible directions.

As said, each ascending path starts at the saddle point by going up alocal maximal slope around the saddle point and there may be severalsuch local maximal slope. In these examples, the identifying of thepaths comprises determining the local maximal slope, by determiningslope local maxima around the saddle point. Determining slope localmaxima means finding the steepest ascending directions on the saddlepoint. Determining slope local maxima may comprise computing the radialslope around the saddle point, i.e. computing the ascending directionsthat extend radially about the saddle point. Determining slope localmaxima may further comprise determining the local maxima of the computedradial slope around the saddle point, such that the determined slopelocal maxima around the saddle point are in examples local maxima of theradial slope around the saddle point. This improves simplicity andefficiency of the watershed segmentation method.

In examples, the identifying of the paths ascending from the saddlepoint comprises projecting mesh elements comprising the saddle pointonto a plane. In these examples, the radial slope around the saddlepoint is a direction angle around a projection of the saddle point inthe plane. These examples are now discussed.

In these examples, the mesh may be parametrized by a 2D subset of theOxy plane (i.e. which is the plane onto which the mesh elements areprojected), the 2D subset being a domain. In other words, the projectionof the mesh elements (e.g. mesh tiles or faces, such as triangle faces)induces a meshing of the 2D subset. In examples of these examples, themesh is a 3D triangular mesh (i.e. the mesh elements are triangles) andmay be parametrized by a 2D subset of the Oxy plane, the 2D subset beinga domain. In these examples, the projection of the triangles induces atriangulation of the domain, i.e. there are no overhanging triangles inthe 3D triangular mesh.

Projecting the mesh elements may comprise computing the parametrizationof the mesh by the 2D subset. Additionally or alternatively, projectingthe mesh elements may comprise providing the parametrization, e.g. byretrieving it from a (e.g. distant) memory where it has been storedafter its computing. In any case, the projecting of the mesh elementsonto the Oxy plane yields the 2D subset or at least a part of the 2Dsubset comprising the projection of the mesh elements comprising thesaddle point.

The saddle point, being part of the projected mesh elements, is alsoprojected on the plane. The projection of the saddle point is thus a 2Dpoint of the 2D subset which is the pole of a polar coordinate systemparametrizing the plane. The direction angle around the saddle point isthe angle of the polar coordinate system, and thus belongs to [0,2π].The radial slope around the saddle point is then a function of thedirection angle, the function being any function which takes as input adirection angle (i.e. belonging to [0,2π]) and which outputs the slopein the direction of the direction angle. The outputted slope in thedirection of the direction angle is the radial slope in the direction ofthe direction angle. The watershed segmentation method thus determinesthe direction(s) of local maximal slope around the saddle point in anefficient, robust and simple manner, by reducing this determination to asimple and robust computation of local maxima of a function of thedirection angle.

As previously discussed, the watershed segmentation method comprisesdetermining the local maxima of this radial slope, e.g. according to anyknown method for determining local maxima of the function of thedirection angle.

The identifying of the paths each ascending from the saddle point mayfurther comprise, after determining each direction of a local maximalslope, computing each path starting from the saddle point according toone direction of a local maximal slope and ascending up to an endingpoint according to a steepest ascending slope, as previously discussed.The computing of each path may be carried out according to any methodable to compute a steepest ascending path from a given point P on themesh.

An example of such a method is now discussed. In this example, the meshis a 3D triangular mesh. In this example, the watershed segmentationmethod takes as input any point of the mesh and compute a path ascendingfrom this point according to the steepest ascent direction. This may becarried out by executing the following algorithm, which may be referredto as the “Compute Ascending path from a point P” algorithm, and whichis described by the following pseudo-code:

BEGIN ALGORITHM (Compute Ascending path from a point P) While (P is nota maximum and P is not on the terrain boundary) - If P lies inside theinterior a triangle T ∘ Move P along the steepest ascent direction untilit reaches a point of the boundary of T - If P lies inside an edgeinterior e=[v₁, v₂] ∘ If e is a ridge ▪ Move P to the uppermostextremity of e ∘ Else, let T1 and T2 the two triangles sharing e, andlet T1 be the upward triangle ▪ Move P along the steepest ascendingdirection in T1 until it reaches a point on T1 boundary - If P is avertex, ∘ Consider all the slopes around P (could be the slope on atriangle having P on its boundary; or an edge having P as one itsextremity), and determine the entity s of maximal ascending slope ▪ If sis an edge → Move P to the uppermost extremity of s ▪ If s is a triangle→ Move P along the steepest ascending direction in T1 until it reaches apoint on s boundary END ALGORITHM

FIGS. 11 to 14 illustrate different kinds of drop moves. FIG. 11 shows adrop move from inside a triangle. FIG. 12 shows a drop move along aridge. FIG. 13 shows a drop move through a triangle. FIG. 14 shows adrop move from a mesh vertex.

It is to be understood that the computing of each ascending paths maycomprise applying the above algorithm when P is the saddle point and foreach steepest ascent direction around P, such that each path ascendingfrom P according to a steepest ascent direction is computed by the abovealgorithm.

The computing of the watershed segmentation further includes, for eachidentified saddle point, identifying a path descending from the saddlepoint according to a direction of a steepest slope around the saddlepoint. By “a path descending from the saddle point according to adirection of a steepest slope around the saddle point”, it is meant “thesteepest descending path around/from the saddle point”. The pathdescending from the saddle point according to the direction of asteepest slope around the saddle point may also be referred to as thevalley of steepest descent around the saddle point. The steepest descentis such that, by following it, any drop of water will flow toward alocal minimum critical point of the altitude function and/or a pointlocated on the boundary of the terrain.

The identifying of the path descending from the saddle point accordingto the direction of the steepest slope around the saddle point maycomprise computing a slope global minimum around a saddle point. Theslope global minimum is in example a global minimum of the radial slopearound the saddle point and computing it may comprise determining theglobal minimum of the radial slope around the saddle point. Determiningthe global minimum of the radial slope may be carried out by projectingthe mesh elements comprising the saddle point onto the plane andcomputing the global minimum of the previously discussed function of thedirection angle around the saddle point. The identifying of the pathdescending from the saddle point according to the direction of thesteepest slope may comprise computing the path starting at the saddlepoint according to the direction of steepest decent (e.g. the directionof the minimal radial slope around the saddle point) and descending fromthe saddle point always according to the steepest possible descentdirection.

In examples, there are two valley of steepest descent around the saddlepoint (i.e. same unit vector). In these examples, the identifying of thepath descending from the saddle point may comprise applying a symbolicperturbation to the mesh (but without modifying the geometry) anddetermining the lowest unitary vector among the two valleys, i.e. theunitary vector of a valley that corresponds to the steepest descentaround the saddle point. Determining whether a first unitary vector islower than a second unitary vector comprises comparing the z-coordinatesof the first and second unitary vectors. In case of an equality,determining whether the first unitary vector is lower than the secondunitary vector comprises then comparing the x-coordinates of the twovectors, and then the y-coordinates in case of an equality between thex-coordinates.

For each identified saddle point, the identified ascending paths divideat least a part of the mesh into connected components. The identifiedascending paths indeed all intersect at the saddle point and theconnected components are each a connected part of the mesh bounded bytwo identified ascending paths and comprising no other identifiedascending paths. All the ascending paths identified for all identifiedsaddle points fully divide the mesh into such connected components.

In examples, the identifying of the paths ascending from the saddlepoint comprises, for each mesh element comprising the saddle point andcomprising at least two local maxima of the radial slope, retrieving,among couples of local maxima of the at least two local maxima of theradial slope, a couple of local maxima of which directions form amaximal angle in the projection of the mesh element. The respectivedirections of the local maxima of the couple yield one of said connectedcomponents. These examples are now further discussed.

In these examples, each mesh element comprising the saddle point isprojected onto a plane as previously discussed. Then, the identifying ofthe paths comprises determining each direction angle around theprojection of the saddle point on the plane which corresponds to a localmaxima of the radial slope, as previously discussed. Each projected meshelement comprises either no local maxima of the radial slope, e.g. ifthe mesh element belongs to the lower star of the saddle point, or oneor more local maxima of the radial slope, e.g. if the mesh elementbelongs to the upper star of the saddle point. For each mesh elementcomprising at least two local maxima of the radial slope, the watershedsegmentation method retrieves the two local maxima of the radial slopewhich correspond to two respective direction angles forming a maximalangle in the projection of the mesh element. The angle is maximal amongall angles formed by couples of respective direction angles. Theidentified ascending paths which ascend from the saddle point accordingto the two directions corresponding to these two local maxima of theradial slope intersect at the saddle point. They also each form aboundary between two connected components dividing the mesh. This holdsfor each projected mesh element comprising at least two local maxima ofthe radial slope.

In other words, for each identified saddle point, the identifiedascending paths divide at least a part of the mesh into connectedcomponents which are each bounded by one of the followings:

-   -   a couple of ascending paths each ascending from the saddle point        according to two direction angles forming a maximal angle in a        same projected mesh element,    -   an ascending path belonging to such a couple of ascending paths        and another ascending path belonging to another such couple of        ascending paths, or    -   an ascending path belonging to such a couple of ascending paths        and another ascending path ascending from the saddle point        according to the direction angle corresponding to a unique        radial slope local maxima of a projected mesh element.

The identified ascending paths all intersect at the saddle point. Eachconnected component comprises no other identified ascending path thanthe ones bounding the connected component. All the paths identified forall identified saddle points fully divide the mesh into such connectedcomponents.

In examples, the retrieving of the couple forming the maximal anglecomprises retrieving a first local maxima of the radial slope and a lastmaxima of the radial slope according to a trigonometric order or to ananti-trigonometric order in the projection of the mesh element. Thisimproves simplicity, efficiency and robustness of the watershedsegmentation method, as it ensures to retrieve the couple by simplymoving angularly about the projection of the saddle point in theprojection of the mesh element to retrieve the first and last localmaxima of the radial slope. These retrieved first and last local maximaform the retrieved couple.

It is to be understood that the identifying of the paths is carried outfor each identified saddle point. The mesh is fully divided intoconnected components by all these identified ascending paths. Then, thewatershed segmentation method further comprises, for each identifiedsaddle point, merging each connected component of which bottom point isthe saddle point with a connected component comprising the identifiedpath descending from the saddle point according to a direction of asteepest slope around the saddle point. The merging yields at least apart of a basin.

Merging connected components means connecting the connected components,so as to form one connected component of the mesh. For each identifiedsaddle point, the connected components which are merged thus form aconnected component of the mesh which represents at least a part of abasin. The identified ascending paths are such that this formedconnected component is bounded by ascending paths each ascending fromthe saddle point according to local maximal slope directions around thesaddle point. These ascending paths are such that any drop of water onthe at least a part of the basin represented by this connected componentnecessarily flows towards the outlet of the basin.

The merging is a carried out for all identified saddle points, e.g.iteratively. For each identified saddle point, the corresponding mergingresults in connected components of the mesh which forms at least a partof a basin. It is to be understood that the at least a part of the basinmay consist in the basin. Alternatively, it may consist in a strict partof the basin, the basin or at least other parts of it being yielded bymerging connected components bounded by other ascending paths identifiedfor other identified saddle points. In other words, as the merging iscarried out for all identified saddle points, the watershed segmentationeventually yields, as a result of all these merges, connected componentsof the mesh each representing a full basin. These full basins form awatershed segmentation of the terrain.

Examples of the merging are now further discussed. In these examples, by“merging”, it is understood not the merging carried out for a givenidentified saddle point, but the combination of all mergings carried outfor all identified saddle points, as previously discussed.

In these examples, the merging comprises determining a graph havingnodes each representing a connected component and arcs each representinga connection between two connected components. In these examples, themerging further comprises extracting the connected components of thegraph. Each connected component of the graph represents a basin of theterrain. This is a robust and efficient manner of merging connectedcomponents so as to yield the basins of the watershed segmentation.

Each node of the graph represents a connected component among theconnected components which divide the mesh. Determining the graph maycomprise assigning the node to the connected component. The identifiedascending paths are such that the bottom point of the connectedcomponent is either a saddle point or a local minimum of the altitude,and this for each connected component. Determining the graph may furthercomprise creating arcs each connecting two nodes representing twoconnected components and each representing a connection between the twoconnected components. Creating arcs may comprise, for each noderepresenting a connected component having a saddle point as a bottompoint, creating an arc between this node and the node representing to aconnected component of the mesh that is located below the saddle pointand that comprises the identified path descending from the saddle pointaccording to a direction of a steepest slope around the saddle point.Thus, in examples, each node representing a connected component having asaddle point as a bottom point is connected by an arc in the graph to anode representing a connected component of the mesh that is locatedbelow the saddle point and that comprises the identified path descendingfrom the saddle point according to the direction of the steepest slopearound the saddle point. The connected component of the mesh that islocated below the saddle point and that comprises the identified pathdescending from the saddle point according to the direction of thesteepest slope around the saddle point is unique.

In examples, the computing of the watershed segmentation according tothe watershed segmentation method is carried out by executing analgorithm which is now discussed. The algorithm of these examples isdescribed by the following pseudo-code:

Begin Algorithm (Compute the Watershed Segmentation of the Terrain Basedon the Mesh, the Watershed Segmentation being Given by the Boundary ofthe Basins):

-   -   determine all the saddle points according to the “Determine if a        vertex V is a saddle point” algorithm;    -   determine the local maxima θ_(i) of the slope around each saddle        point V. For that, consider the slope around V as a function        (called the radial slope) depending θ which represents any        direction angle between [0, 2 π] around V in the Oxy plane;    -   For any saddle point V, compute the global minimum of the radial        slope function (which is an angle): this direction gives rise        the valley of steepest descent denoted vat;    -   For each connected component Cc of the upper star of V, apply        the following process:        -   If there is only one local maximum θ_(i) inside Cc, compute            an ascending path from V which starting direction is given            by θ_(i), according to the “Compute Ascending path from a            point P” algorithm;        -   Else, retrieve the first and the last local maximum θ_(ƒ) et            θ_(i) of the radial slope, which are the first and the last            maximal slope using trigonometric order (counterclockwise)            around V, restricted to the Cc component. Then, compute the            ascending paths from V with starting directions θ_(ƒ) and            θ₁;        -   All these paths divide the terrain into connected            components, which form the nodes of a graph G. The bottom            point of each node is either;            -   A degenerate saddle point            -   A local minimum;        -   In the first case, create an arc between this node and the            node corresponding to the unique valley vat of the            degenerate saddle point.        -   The resulting basins are given by the connected component of            the graph G.

According to the above algorithm, all the water reaching the vertex V(from the connected components of the upper star) will then flow throughthe valley val and remain in the same basin.

FIGS. 15 and 16 illustrate the above algorithm. FIG. 15 shows adegenerate saddle point (which corresponds to the center of the circle),with its valley val of steepest descent, the three connected components150, 152 and 154 of its upper star, and for each of them the first andlast direction angles θ_(ƒ) and θ_(l). FIG. 16 shows the result of themerging around the saddle point (one different shade of grey per eachbasin 160, 162, 164).

The above algorithm is efficient, notably because there is no need tobrowse all the mesh vertices, but only the saddle points. Thereby, thecomplexity of the computation depends on the number of saddle points andnot on the mesh vertices. Subdividing the mesh triangles as does theabove algorithm has little incidence on the computation time. Inparticular, doubling the number of triangles for the same geometry willnot double the computation time. The above algorithm is also accurate,because the basin boundaries are not constrained by terrain edges andfollow the steepest ascending direction.

In examples where the mesh is a triangular mesh, triangles that arecrossed by ascending watershed lines are split during the computing ofthe watershed segmentation, the resulting fragments being associated tobasins yielded as output. Thus, in these examples, the watershedsegmentation method is not bounded to follow the mesh edges whenidentifying paths, which makes the watershed segmentation method robustand ensures relatively accurate results.

In any case, the computed watershed segmentation is accurate in that itis consistent with water trajectory: the watershed segmentation methodguaranties indeed that any trajectory of any drop lying inside a givenbasin ends up at the outlet of the basin. Also, the watershedsegmentation method does not require any modification of the inputterrain (i.e. the provided mesh), e.g. by adding and/or removing vertexand/or by altering vertex coordinates. In particular, the watershedsegmentation does not require any splitting of degenerate saddle pointinto regular saddle points, which makes the watershed segmentationmethod particularly robust.

The watershed segmentation method may further comprise displaying, on acomputer display, the computed watershed segmentation. Displaying thecomputed watershed segmentation allows to perform, as previouslydiscussed, a civil engineering analysis and/or one or more physicalactions based on the displayed computed watershed segmentation.

The regularization method is now further discussed.

The regularization method comprises providing a watershed segmentationof a terrain. The watershed segmentation comprises basins. The conceptof watershed segmentation has been previously discussed and is notfurther discussed.

The providing of the watershed segmentation may comprise computing thewatershed segmentation, by any known method. For example, the providingof the watershed segmentation may comprise computing the watershedsegmentation according to the watershed segmentation method aspreviously discussed. Alternatively, the providing of the watershedsegmentation may comprise retrieving the watershed segmentation from a(e.g. distant) memory where it has been stored after its computing (e.g.according to the watershed segmentation method).

The regularization method further comprises merging first basins of thewatershed segmentation that each verify a smallness criterion, each witha second basin downstream to the first basin. This means that theregularization method explores (e.g. all) the basins of the watershedsegmentation and merges each explored first basin verifying a smallnesscriterion with a second basin downstream to the first basin. The secondbasin is the downstream basin of the first basin that is the basinadjacent to the first basin through the spillway of the first basin.This allows merging of small basins (i.e. with respect to the smallnesscriterion) each with downstream second basins, which ultimately resultsin that the watershed segmentation be regularized: the watershedsegmentation, after the merging, comprises only or relatively only largebasins, i.e. each violating the smallness criterion. It is to beunderstood that second basins and/or merged basins may also be firstbasins verifying the smallness criterion, in which case they are alsomerged with their downstream basins. Therefore, each basin of theregularized watershed segmentation is the result of the merging of twoor more basins of the provided watershed segmentation.

A basin satisfying the smallness criterion is a basin that is relativelysmall. In examples, this means that the basin is so small that it is notrelevant to the civil engineer, e.g. when performing a civil engineeringanalysis. Additionally or alternatively it may mean that the basincorresponds to a numerical artefact and/or a noise within the watershedsegmentation but does not exist in the real world.

In examples, a basin verifies the smallness criterion if aquantification of a smallness of the basin is lower than a predefinedthreshold. The predefined threshold may be a threshold value defined bya user (e.g. a civil engineer) beforehand, that is before performing theregularization method. This allows merging of first basins of thesegmentation that are too small to exist in the real world and/or thatare too small to be relevant to the civil engineer. The quantificationof the smallness may be any value representing the smallness of thebasin. In examples, the quantification of the smallness of the basincomprises one or more of a quantification of a depth of the basin, aquantification of an area of the basin and/or a quantification of avolume of the basin. If the quantification of the smallness of the basinis a quantification of the depth of the basin, the threshold's order ofmagnitude may be the meter (e.g. for a model of the whole terrain) orthe decimeter (e.g. for an urban model). If the quantification of thesmallness of the basin is a quantification of the area of the basin, thethreshold's order of magnitude may be the square meter. If thequantification of the smallness of the basin is a quantification of thevolume of the basin, the threshold's order of magnitude may be the cubicmeter (e.g. in the context of dyke study) or much less (e.g. in thecontext of drainage study, as the civil engineer will later beinterested in the speed with which a basin fills itself). Thequantification of a depth of the basin may be a depth value of the basinthat is a value of the depth of the basin. The quantification of an areaof the basin may be an area value of the basin that is a value of thearea of the basin. The quantification of a volume of the basin may be avolume value of the basin that is a value of the volume of the basin.

The merging is now further discussed.

The merging may be carried out iteratively, that is the merging maycomprise iteratively exploring basins of the watershed segmentation. Themerging may iteratively identify explored basins which are first basinsverifying the smallness criterion. Each identified first basin is mergedwith (e.g. connected to) a second basin which is the basin downstream tothe first basin. It is to be understood that the second basin may alsobe a first basin verifying the smallness criterion, in which case thesecond basin is also merged with its downstream second basin during themerging.

In examples, the merging comprises determining an oriented graph havingnodes and arcs. Each node represents a basin. Each arc represents aconnection between a first basin that verifies the smallness criterionand a second basin downstream to the first basin. The arc is orientedfrom a first node representing the first basin to a second noderepresenting the second basin. In these examples, the merging furthercomprises merging the basins corresponding to nodes of a same connectedcomponent of the oriented graph. The graph may be a directed acyclicgraph (referred to as “DAG” hereinafter).

Determining the oriented graph and carrying out the merging of firstbasins with second basins by merging the basins corresponding to nodesof a same connected component in the graph is an efficient and robustmanner of carrying out the merging, and thus of regularizing theprovided watershed segmentation. Notably, the graph forms a datastructure which captures well the arrangement of the small basinsrelative to one another in terms of which basin is upstream ordownstream of another basin. Indeed, the nodes of a connected componentof the graph represent a group of basins which:

-   -   are two by two downstream to each other; and    -   are each downstream to a respective first basin of the group        verifying the smallness criterion, except for the basin of the        group which is the most upstream.

This amounts to say that the basins form a DAG indicating the order inwhich the basins will poor into each other.

Thereby, merging the basins corresponding to nodes of a same connectedcomponent of the graph yields efficiently a basin of the regularizedwatershed segmentation, that is which violates the smallness criterion.

In examples, the determining of the oriented graph comprises exploringthe basins according to a smallness order that rewards basin smallness.In these examples, the determining of the oriented graph furthercomprise, for each explored first basin verifying the smallnesscriterion, creating an arc between the node representing the first basinand the node representing a second basin downstream to the first basin.The arc is oriented from the node representing the first basin to thenode representing the second basin. Prior to the creating of the arcs,the determining may comprise, for each explored basin, creating a nodein the graph representing the basin. In any case, the graph resultingfrom the creating of the arcs is a DAG.

The smallness order is an order that rewards basin smallness. In otherwords, a basin comes before another basin in the smallness order if thebasin is smaller than another basin. Exploring the basins according tothe smallness order thus consists in exploring first the smallest basinof the provided watershed segmentation, exploring then the smallestbasin among non-explored basins of the provided watershed segmentation,exploring then the smallest basin among non-explored basins of theprovided watershed segmentation, and so on, until all basins of theprovided watershed segmentation are explored. Exploring the basins maycomprise, for each basin, computing the previously-discussedquantification of the smallness of the basin, for example by computingthe depth of the basin, the area of the basin or the volume of thebasin. Exploring the basins may further comprise sorting the basinsaccording to increasing quantification of the smallness, e.g. by sortingthe basins according to increasing depth (the smallness order being thena depth order), according to increasing area (the smallness order beingthen an area order) or according to increasing volume (the smallnessorder being then a volume order). Exploring the basin may then compriseexploring (e.g. visiting) the sorted basins along the smallness order.

Exploring the basins according to the smallness order is an efficientand robust manner of ensuring that connected components of the grapheach represent a group of basins which are two by two downstream to eachother, and which are each downstream to a respective first basin of thegroup verifying the smallness criterion, except for the basin of thegroup which is the most upstream. Merging basins of each respective oneof these groups thus efficiently yield a respective basin of theregularized watershed segmentation.

In examples, the watershed segmentation comprises, for each basin, datarepresenting water trajectory within the basin. In these examples, themerging comprises, for each first basin that is merged with a secondbasin, computing data representing a water trajectory between the firstbasin and the second basin. Thereby, besides regularizing the providedwatershed segmentation, the regularization method also yields watertrajectory within each basin of the regularized watershed segmentation.The regularized watershed segmentation outputted by the regularizationmethod thus allows the understanding of the water trajectory and/or thevisualizing of the impact of any earthworks on the water dynamic, whichis very relevant for civil engineering. Said otherwise, theregularization method may regularize the provided watershed segmentationand update water trajectory accordingly and simultaneously.

The data representing trajectory within the basin may be any datarepresenting the trajectory of any flow of water within the basin, suchas one or more paths within the basin. In examples, the one or morepaths comprise a path from the outlet of the basin to the spillway ofthe basin, also referred to as “extending ascending path”, and/or a pathfrom the spillway of the upstream basin of the basin to the outlet ofthe basin, also referred to as “extending descending path”. The datarepresenting a water trajectory between the first basin and the secondbasin may be any data representing the trajectory of any flow of waterflowing from the first basin into the second basin and may be computedbased on data representing water trajectory within the first and secondbasins.

The computing of the data representing the water trajectory between thefirst basin and the second basin may be based on (e.g. may take asinput) on first data representing water trajectory within the firstbasin and second data representing water trajectory within the secondbasin. This improves accuracy of the computed water trajectory betweenthe first basin and the second basin. In examples, the first datacomprise the extending ascending path from an outlet of the first basinto a spillway of the first basin, and/or the second data comprise theextending descending path from a spillway of the first basin to anoutlet of the second basin.

In examples, the first data comprise the extending ascending path froman outlet of the first basin to a spillway of the first basin and thesecond data comprise the extending descending path from a spillway ofthe first basin to an outlet of the second basin. In these examples, thecomputing of the data representing the water trajectory between thefirst basin and the second basin may take as input said extendingascending and extending descending paths and output a path, which may bereferred to as “extended path”, which corresponds to the concatenationof said extending ascending and extending descending paths. In otherwords, the extended path connects the outlet of the first basin to thespillway of the first basin according to the extending ascending path,and then connects the spillway of the first basin to the outlet of thesecond basin according to the extending descending path. As this is donefor each merging of a first basin with a downstream second basin, thisensures that any water path reaching a former outlet (i.e. an outlet ofthe provided watershed segmentation) be able to be extended until itreaches an outlet of a filtered basin (i.e. a basin of the regularizedwatershed segmentation). Such a trajectory of a drop toward an outlet ofthe filtered (i.e. regularized) watershed segmentation forms an extendedpath. Extended paths constitute objective physical informationparticularly relevant for civil engineering.

The regularization method may further comprise displaying, on a computerdisplay, the regularized watershed segmentation. Displaying theregularized watershed segmentation allows to perform, as previouslydiscussed, a civil engineering analysis and/or one or more physicalactions based on the displayed regularized watershed segmentation.

An example of the regularization method is now discussed.

In this example, the provided watershed segmentation contains manyshallow basins that harm the readability of the result. This isillustrated on FIG. 17, showing a screenshot of the provided watershedsegmentation as displayed on a computer display. It may difficult forthe user (e.g. the civil engineer) to understand the water trajectoryand visualize the impact of any earthworks on the water dynamic based onthis displayed provided watershed segmentation.

In this example, the merging comprises the exploring of the basinsaccording to the smallness order, as previously discussed. The exploringcomprises sorting the original basins (i.e. the basins of the providedwatershed segmentation) following an increasing depth (resp. area, resp.volume) ordering. The exploring further comprises creating a DirectedAcyclic Graph (DAG) whose nodes are the initial basins.

Then, following increasing depth (resp. area, resp. volume) ordering,for each basin B, the exploring comprises creating an oriented arc inthe graph joining B toward its downstream basin B′. Simultaneously, theexploring comprises associating to this arc two paths called extendingpaths P_(Ascending) and P_(Descending): P_(Ascending) from the outletO_(B) of B to the spillway of B, and P Descending from the spillway of Bto the outlet of B′, denoted O_(B′). FIG. 19 illustrates these paths.

Then, the set of basins in each connected component of the graph aremerged into so-called filtered basins, forming the regularized (i.e.filtered) watershed segmentation. The remaining (i.e. filtered) basinshave a depth greater than the given threshold. FIG. 20 shows theremaining basin after the merging of the basins B and B′ of FIG. 19.

In this example, the merging is carried out by executing the algorithmdescribed by the following pseudo-code:

BEGIN ALGORITHM ∘ Create an empty DAG; ∘ For each initial basin, createa corresponding vertex in DAG; ∘ Sort the basins according to increasingdepth; ∘ Along this order, while there is a basin B which depth (resp.area, resp. volume) is lower than a predefined threshold specified by auser: ∘ Let c be the spillway of B. c lies on a polyline shared by B andits downstream basin B′. Add an arc from B to B′ in the DAG; ∘ Let o bethe outlet of B and o′ the one of B′. Compute the two extending pathsP_(Ascending) and P_(Descending); ∘ Create a new empty watershedsegmentation that will store the filtered basins: ∘ For each connectedcomponent in the DAG, create a new basin as the union of all the initialbasins in the connected component. END ALGORITHM

FIG. 18 shows the result of the merging of the segmentation of FIG. 17according to the above algorithm, where the depth threshold equals 0.5mm. FIG. 21 shows the computed water trajectory between the first basinB and the second basin B′ of FIG. 19. FIGS. 22 and 23 further illustratethe merging according to the above algorithm. FIG. 22 shows two basinsof the provided watershed segmentation. Note that basin 1 has a smalldepth and satisfies the smallness criterion. FIG. 23 shows the effect ofthe merging: only one basin remains after the merging.

In this example, the water trajectory and the watershed segmentationremain consistent after the merging. Whatever the depth threshold epsgiven by the user (and even if eps=0), any path remains included in thebasin that contains the starting point and will reach the outlet of thisbasin (or the edge of the ground). Thus, when eps>0, the merged basinsstill form a new segmentation of the terrain that verifies the previousproperty. This is illustrated on FIG. 24, showing original watertrajectories (which stop when reaching an outlet), and on FIG. 25,showing the computed extended path using eps=1 m.

The contributor computation method is now further discussed.

The contributor computation method comprises providing a meshrepresenting a terrain. The providing of the mesh representing theterrain has been previously discussed and is not further discussed. Thecontributor computation method further comprises providing a polyline onthe mesh.

The polyline is a line formed by vertices of the mesh and edges of themesh each connecting two of said vertices. Providing the polyline maycomprise defining the polyline on the mesh, e.g. by graphical userinteraction. For example, the mesh may be displayed on a computerdisplay and a user may define the line by interacting graphically withthe display, e.g. using a touch or a haptic device. The user may forexample draw the line or select the vertices and/or the edges of theline. Alternatively, the polyline may already be defined on the meshwhen the mesh is provided. In such a case, the polyline is provided withthe mesh. The polyline may represent a construction on the terrain,which may be a construction terrain. For example, the polyline mayrepresent a road, a railroad, a channel, a building or a mine.

The contributor computation method further comprises computing acontributor of the polyline. As previously explained, the contributor isthe set of points of the mesh from which water will necessarily flowtowards a point of the polyline. The polyline may be connected and/oropen or close. The contributor is computed in any case, which makes thecontributor computation method robust.

The computing of the contributor comprises modifying the mesh bydetermining, based on the polyline, a trench below the polyline. Inother words, the modifying yields a modified mesh which is identical tothe provided mesh except for the polyline which is replaced by a trenchbelow the polyline. In examples, the modifying of the mesh comprisestransforming (e.g. deforming, mapping) the polyline into the trench,e.g. by continuously bending the polyline. For example, continuouslybending the polyline may comprise lowering the altitude coordinates ofthe points of the polyline in such a way that there is only one altitudelocal minimum along the trench and that the points of the trench are alllower than the original mesh vertices. For example, if the polyline has2N points, the altitude coordinate on the trench decreases from point 0to point N−1, and then increases from point N to point 2N−1. The trenchis a part of the mesh which has substantially the shape of a trench,such as a U-shape or a V-shape below the polyline.

In examples, each point of the polyline corresponds to a point of thetrench. In other words, the modifying consists in mapping of thepolyline onto the trench. For example, the mapping may consists inmapping each vertex of the polyline, said vertex belonging to theprovided mesh, onto a corresponding vertex of the trench, said vertexbelonging to the modified mesh. In these examples, each point of thetrench has an altitude lower than the corresponding point on thepolyline. In other words, the mapping lowers the altitudes of the points(e.g. the vertices) of the polyline so as to transform it into thetrench. This is a simple, robust and efficient manner of determining thetrench.

An example of the modifying of the mesh is now discussed. In thisexample, the modifying consists in applying a mapping to the vertices ofthe polyline, the mapping lowering the altitudes of these vertices so asto transform them into vertices of the trench, thereby transforming thepolyline into the trench. In this example, the modifying is carried outby executing the following algorithm, which may be referred to as the“modify the altitude of the points of the polyline” algorithm, and whichis described by the following pseudo-code:

BEGIN ALGORITHM (modify the altitude of the points on the polyline) Letz_(min) the lowest z-coordinate on all the mesh vertices Let N be thenumber of vertices of the polyline, From i = 1 to N/2  Change thez-coordinate of the i-th vertex along the polyline by z_(min)  ${- 1} - \frac{i}{2\; N}$ From i = (N/2) + 1 to N  Change thez-coordinate of the i-th vertex along the polyline by z_(min)  ${- 1} - \frac{N - i}{2N}$ END ALGORITHM

In examples, only one of the points of the trench is an altitude localminimum. In other words, the modifying of the mesh results in that onlyone point (e.g. only one vertex) of the trench has a minimal altitudeamong all points (e.g. vertices) of the trench. This eventually improvesrobustness of the computing of the watershed segmentation and of theidentifying of the basin comprising the mesh, which are now discussed.

The computing of the contributor of the polyline further comprisescomputing a watershed segmentation of the terrain based on the modifiedmesh. In other words, the computing of the watershed segmentation takesas input the modified mesh and outputs a watershed segmentation of theterrain from the input modified mesh. The computing of the watershedsegmentation may be carried out according to any method for computingwatershed segmentation based on a mesh. In examples, the computing ofthe watershed segmentation comprises applying the watershed segmentationmethod, as previously discussed. In such a case, the computing of thewatershed segmentation benefits from the previously discussedimprovements of accuracy, efficiency and robustness provided by thewatershed segmentation method.

In examples, the computing of the watershed segmentation comprisescomputing, e.g. by applying the watershed segmentation method, aninitial watershed segmentation of the terrain based on the modifiedmesh. In these examples, the computing of the watershed segmentationfurther comprises performing, e.g. by applying the regularizationmethod, a regularization of the computed initial watershed segmentation.This allows the identifying of the basin to be performed on aregularized (i.e. filtered) watershed segmentation, initially computedbased on the modified mesh. This indeed removes from the initialwatershed segmentation basins which are so small, e.g. which have a sosmall depth, area and/or volume value, that they correspond to anumerical artefact and/or to a noise of the computing of the initialwatershed segmentation and/or that they are not relevant from the civilengineering point of view. Eventually, the identifying of a basincomprising the trench is improved, as it is ensured that the identifiedbasin will not correspond to a basin so small that it should bediscarded and not identified, for the reasons explained above. Moreover,the regularization yields in examples an identified basin which islarger than the one identified without the regularization. Thereby,these examples yield a computed contributor which is larger and/or morerelevant to the civil engineer. This contributor may be referred to asthe “extended” contributor.

In any case, the computing of the watershed segmentation results in thatthe modified mesh is segmented into parts each representing a basin ofthe computed watershed segmentation. The trench, because of its shape(e.g. because the trench comprises only one altitude local minimum), isincluded into one basin having as outlet a point of the mesh. Thecomputing of the contributor further comprises, based on the computedwatershed segmentation, identifying, on the modified mesh, a basincomprising the trench. In other words, the identifying searches amongbasins of the computed watershed segmentation the one basin into whichthe trench is included and having as outlet the point of the mesh andidentifies this basin. In yet other words, the identified basincomprising the trench is the one basin into which the trench is includedand having as outlet the point of the mesh. In examples, only one of thepoints of the trench is an altitude local minimum and the identifiedbasin has as outlet this altitude local minimum.

The identified basin corresponds to the contributor. This means that theidentified basin, belonging to the modified mesh, corresponds to thepart of the provided mesh which represents the contributor.Specifically, the identified basin consists in (e.g. is the union of)the trench and another part of the modified mesh. Said another part isidentical in the modified mesh and in the provided mesh. The contributorthen consists in (e.g. is the union of) the polyline and said anotherpart. In examples, the computing of the contributor further comprisesmodifying the basin by transforming back the trench into the polyline.The modified basin resulting from this modifying is the contributor, asthe trench is transformed back into the polyline. In other words, themodified basin is made of the polyline and of said another part, andthereby is the contributor. Transforming back the trench into thepolyline means inverting the modifying of the mesh which resulted indetermining the trench based on the polyline. For example, if thepolyline has been mapped onto the trench by the modifying as previouslydiscussed, transforming back means applying the inverse mapping to thetrench to map it back onto the polyline.

An example of the computing of the contributor is now discussed. In thisexample, the mesh is a 3D triangular mesh. In this example, thecomputing of the contributor is carried out by executing the followingalgorithm, described by the following pseudo-code:

BEGIN ALGORITHM - To compute the contributor of the polyline denoted P,duplicate the initial terrain (i.e. the provided mesh) and insert thepoints - denoted S_(i) - of P into the copy of terrain (i.e. themodified mesh) (denoted M′), by subdividing the triangles containing thepoints S_(i). Note that the copy of the terrain mesh is hidden from theuser and is of internal purpose only. - Then, modify the z-coordinate ofthe inserted points, by applying the “modify the altitude of the pointson the polyline” algorithm to fill the following properties: ∘ Everypoint S_(i) has an altitude lower than any point of the originalterrain. ∘ Only one of the points S_(i) is a local minimum of thealtitude function (this local minimum will be turned into an outlet of abasin): The polyline which vertices have been modified to fill theprevious properties is the trench. - Then, compute the watershedsegmentation on this modified terrain. The contributor of the polylineis given by the basin which outlet is located on the trench (i.e. whichoutlet is one of the points S_(i)). - Extract the mesh of this basin,and then restore the z-coordinates of the points lying on the trench,which induces that the resulting mesh is a subset of the initialterrain. This resulting mesh is precisely the contributor, and any pathstarting from a point contained in the result will cross the targetpolyline. END ALGORITHM

FIGS. 26 to 36 illustrate the above algorithm and are now discussed.

FIG. 26 shows the terrain and a polyline 260 on the terrain. FIG. 27shows the determined trench 270. FIG. 28 shows the identified basin 280of the watershed segmentation computed on the modified mesh. FIG. 29shows the computed contributor 290 of the polyline, retrieved byrestoring the coordinates.

FIG. 30 shows a terrain and a polyline 300 representing an alignment onthe terrain. FIG. 31 shows a sectional view of the trench 310 on themodified mesh of the terrain. FIG. 32 shows the identified basin 320(circled in FIG. 32) on the computed watershed segmentation of themodified mesh. This identified basin's outlet is located on the trench310 of FIG. 31. FIG. 33 shows the computed contributor 330 of thepolyline 300 of FIG. 30.

As previously discussed, the computing of the watershed segmentation maycomprise computing initial watershed segmentation according to thewatershed segmentation method and performing a regularization of theinitial watershed segmentation by applying the regularization method.The resulting computed segmentation still contains a basin which outletlies on the trench, and this basin gives rise to the extendedcontributor—the contributor on which topological filtering has beenapplied —, which is the result of the topological filtering (i.e. theregularization). It means that any extended path starting from a pointcontained in the extended contributor will cross the input polyline.FIG. 34 shows the extended contributor, computed in such a way, of thepolyline 300 of FIG. 30. FIG. 34 shows the extended contributor forseveral values of depth threshold used when performing theregularization method: 0.5 m (340, red), 1 m (350, dark pink) and 2 m(360, pale pink).

The above algorithm is particularly efficient and accurate. Notably, itcomputes the contributor of the polyline using a single operation aspreviously discussed and is not affected by the complexity of thepolyline (in examples, only the number of critical points matters). Theabove algorithm is in particular much more robust and efficient thanmethods which sample the polyline into points, compute the contributorof each point, and then compute the union of all these contributors. Theresult of the Boolean union of all the contributors of the sample pointsis indeed not equal to the contributor of the polyline. Indeed, it ispossible to find a point out of the Boolean union that flow toward thepolyline. This is illustrated on FIGS. 35 and 36. FIG. 36 shows acontributor of a polyline computed by the above algorithm. FIG. 36 showsthe union of the contributors of the sample points on the polyline.

The contributor computation method may further comprise displaying, on acomputer display, the contributor of the polyline. Displaying thecontributor allows to perform, as previously discussed, a civilengineering analysis and/or one or more physical actions based on thedisplayed contributor.

The watershed segmentation method, the regularization method and thecontributor computation method are computer-implemented methods.

This means that steps (or substantially all the steps) of the methodsare executed by at least one computer, or any system alike. Thus, stepsof the methods are performed by the computer, possibly fullyautomatically, or, semi-automatically. In examples, the triggering of atleast some of the steps of the methods may be performed throughuser-computer interaction. The level of user-computer interactionrequired may depend on the level of automatism foreseen and put inbalance with the need to implement user's wishes. In examples, thislevel may be user-defined and/or pre-defined.

A typical example of computer-implementation of a method is to performthe methods with a system adapted for this purpose. The system maycomprise a processor coupled to a memory and a graphical user interface(GUI), the memory having recorded thereon a computer program comprisinginstructions for performing the methods. The memory may also store adatabase. The memory is any hardware adapted for such storage, possiblycomprising several physical distinct parts (e.g. one for the program,and possibly one for the database).

FIG. 37 shows an example of the system, wherein the system is a clientcomputer system, e.g. a workstation of a user.

The client computer of the example comprises a central processing unit(CPU) 1010 connected to an internal communication BUS 1000, a randomaccess memory (RAM) 1070 also connected to the BUS. The client computeris further provided with a graphical processing unit (GPU) 1110 which isassociated with a video random access memory 1100 connected to the BUS.Video RAM 1100 is also known in the art as frame buffer. A mass storagedevice controller 1020 manages accesses to a mass memory device, such ashard drive 1030. Mass memory devices suitable for tangibly embodyingcomputer program instructions and data include all forms of nonvolatilememory, including by way of example semiconductor memory devices, suchas EPROM, EEPROM, and flash memory devices; magnetic disks such asinternal hard disks and removable disks; magneto-optical disks; andCD-ROM disks 1040. Any of the foregoing may be supplemented by, orincorporated in, specially designed ASICs (application-specificintegrated circuits). A network adapter 1050 manages accesses to anetwork 1060. The client computer may also include a haptic device 1090such as cursor control device, a keyboard or the like. A cursor controldevice is used in the client computer to permit the user to selectivelyposition a cursor at any desired location on display 1080. In addition,the cursor control device allows the user to select various commands,and input control signals. The cursor control device includes a numberof signal generation devices for input control signals to system.Typically, a cursor control device may be a mouse, the button of themouse being used to generate the signals. Alternatively or additionally,the client computer system may comprise a sensitive pad, and/or asensitive screen.

Any computer program herein may comprise instructions executable by acomputer, the instructions comprising means for causing the above systemto perform one or more of the watershed segmentation method, theregularization method and/or the contributor computation method. Theprogram may be recordable on any data storage medium, including thememory of the system. The program may for example be implemented indigital electronic circuitry, or in computer hardware, firmware,software, or in combinations of them. The program may be implemented asan apparatus, for example a product tangibly embodied in amachine-readable storage device for execution by a programmableprocessor. Method steps may be performed by a programmable processorexecuting a program of instructions to perform functions of the methodsby operating on input data and generating output. The processor may thusbe programmable and coupled to receive data and instructions from, andto transmit data and instructions to, a data storage system, at leastone input device, and at least one output device. The applicationprogram may be implemented in a high-level procedural or object-orientedprogramming language, or in assembly or machine language if desired. Inany case, the language may be a compiled or interpreted language. Theprogram may be a full installation program or an update program.Application of the program on the system results in any case ininstructions for performing one or more of the watershed segmentationmethod, the regularization method and/or the contributor computationmethod.

1. A computer-implemented method for civil engineering, the methodcomprising: obtaining a watershed segmentation of a terrain, thewatershed segmentation including basins; and merging first basins of thewatershed segmentation that each verify a smallness criterion, each witha second basin downstream to the first basin.
 2. The method of claim 1,wherein the watershed segmentation includes, for each basin, datarepresenting water trajectory within the basin, and the mergingincludes, for each first basin that is merged with a second basin,computing data representing a water trajectory between the first basinand the second basin.
 3. The method of claim 2, wherein the computing ofthe data representing the water trajectory between the first basin andthe second basin is based on first data representing water trajectorywithin the first basin and second data representing water trajectorywithin the second basin.
 4. The method of claim 3, wherein the firstdata include a path from an outlet of the first basin to a spillway ofthe first basin, and/or the second data include a path from a spillwayof the first basin to an outlet of the second basin.
 5. The method ofclaim 1, wherein the merging further comprises: determining an orientedgraph having nodes and arcs, each node representing a basin, and eacharc representing a connection between a first basin that verifies thesmallness criterion and a second basin downstream to the first basin,the arc being oriented from a first node representing the first basin toa second node representing the second basin; and merging the basinscorresponding to nodes of a same connected component of the orientedgraph.
 6. The method of claim 5, wherein the determining of the orientedgraph further comprises exploring the basins according to a smallnessorder that rewards basin smallness, and for each explored first basinverifying the smallness criterion, creating an arc between the noderepresenting the first basin and the node representing a second basindownstream to the first basin, the arc being oriented from the noderepresenting the first basin to the node representing the second basin.7. The method of claim 1, wherein a basin verifies the smallnesscriterion when a quantification of a smallness of the basin is lowerthan a predefined threshold.
 8. The method of claim 1, wherein thequantification of the smallness of the basin includes one or more of aquantification of a depth of the basin, a quantification of an area ofthe basin and/or a quantification of a volume of the basin.
 9. Themethod of claim 1, wherein the terrain is a construction terrain.
 10. Anon-transitory data storage medium having recorded thereon a computerprogram comprising instructions for performing a method for civilengineering that when executed by a computer causes the computer toimplement the method comprising: obtaining a watershed segmentation of aterrain, the watershed segmentation including basins; and merging firstbasins of the watershed segmentation that each verify a smallnesscriterion, each with a second basin downstream to the first basin. 11.The non-transitory data storage medium of claim 10, wherein thewatershed segmentation includes, for each basin, data representing watertrajectory within the basin, and the merging includes, for each firstbasin that is merged with a second basin, computing data representing awater trajectory between the first basin and the second basin.
 12. Thenon-transitory data storage medium of claim 11, wherein the computing ofthe data representing the water trajectory between the first basin andthe second basin is based on first data representing water trajectorywithin the first basin and second data representing water trajectorywithin the second basin.
 13. The non-transitory data storage medium ofclaim 12, wherein the first data include a path from an outlet of thefirst basin to a spillway of the first basin, and/or the second datainclude a path from a spillway of the first basin to an outlet of thesecond basin.
 14. The non-transitory storage medium of claim 10, whereinthe merging further comprises: determining an oriented graph havingnodes and arcs, each node representing a basin, and each arcrepresenting a connection between a first basin that verifies thesmallness criterion and a second basin downstream to the first basin,the arc being oriented from a first node representing the first basin toa second node representing the second basin; and merging the basinscorresponding to nodes of a same connected component of the orientedgraph.
 15. The non-transitory storage medium of claim 14, wherein thedetermining of the oriented graph further comprises exploring the basinsaccording to a smallness order that rewards basin smallness, and foreach explored first basin verifying the smallness criterion, creating anarc between the node representing the first basin and the noderepresenting a second basin downstream to the first basin, the arc beingoriented from the node representing the first basin to the noderepresenting the second basin.
 16. A computer comprising: a memory; anda processor coupled to the memory, the memory having recorded thereon acomputer program that when executed by the processor causes theprocessor to be configured to: obtain a watershed segmentation of aterrain, the watershed segmentation including basins, and merge firstbasins of the watershed segmentation that each verify a smallnesscriterion, each with a second basin downstream to the first basin. 17.The computer of claim 16, wherein the watershed segmentation includes,for each basin, data representing water trajectory within the basin, andthe processor is further configured to merge, for each first basin thatis merged with a second basin, by being further configured to computedata representing a water trajectory between the first basin and thesecond basin.
 18. The computer of claim 17, wherein the processor isfurther configured to compute the data representing the water trajectorybetween the first basin and the second basin based on first datarepresenting water trajectory within the first basin and second datarepresenting water trajectory within the second basin.
 19. The computerof claim 18, wherein the first data include a path from an outlet of thefirst basin to a spillway of the first basin, and/or the second datainclude a path from a spillway of the first basin to an outlet of thesecond basin.
 20. The computer of claim 16, wherein the processor isfurther configured to merge by being configured to: determine anoriented graph having nodes and arcs, each node representing a basin,and each arc representing a connection between a first basin thatverifies the smallness criterion and a second basin downstream to thefirst basin, the arc being oriented from a first node representing thefirst basin to a second node representing the second basin, and mergethe basins corresponding to nodes of a same connected component of theoriented graph.